﻿using System;
using System.Collections.Generic;
using System.Text;

namespace POSPlus.PrintManager
{
	public abstract class DatabaseObject
	{
		public String ConnectionString { get; private set; }

		public DatabaseObject(String connectionString)
		{
			ConnectionString = connectionString;
		}

		public abstract bool Create();
		public abstract bool Update();
		public abstract bool Delete();
		public abstract void PopulateDefault();

		public static T FromDB<T>(Object value)
		{
			return Convert.IsDBNull(value) ? default(T) : (T)value;
		}
	}
}
